home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / var / lib / dpkg / info / cryptsetup.postinst < prev    next >
Encoding:
Text File  |  2011-03-11  |  2.4 KB  |  87 lines

  1. #! /bin/sh
  2.  
  3. set -e
  4.  
  5. # summary of how this script can be called:
  6. #        * <postinst> `configure' <most-recently-configured-version>
  7. #        * <old-postinst> `abort-upgrade' <new version>
  8. #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
  9. #          <new-version>
  10. #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
  11. #          <failed-install-package> <version> `removing'
  12. #          <conflicting-package> <version>
  13.  
  14. case "$1" in
  15.     configure)
  16.     if [ -x /usr/sbin/update-initramfs ]; then
  17.         update-initramfs -u
  18.     fi
  19.  
  20.     # Do a number of checks on the currently installed crypttab
  21.     
  22.     egrep -v "^[[:space:]]*(#|$)" /etc/crypttab | while read dst src key opts; do
  23.         if [ -z "$dst" ]; then
  24.             continue
  25.         elif [ -z "$src" ] || [ -z "$key" ] || [ -z "$opts" ]; then
  26.             # All fields must be present
  27.             echo "WARNING: $dst in /etc/crypttab is missing some arguments, see man cryptab(5)." >&2
  28.             continue
  29.         else
  30.             # Strip comments - https://bugs.launchpad.net/bugs/185380
  31.             opts=$(echo -n $opts | sed 's/ *#.*//')
  32.             plainopts="0"
  33.             IFS=','
  34.             for opt in $opts; do
  35.                 PARAM=$(echo "$opt" | sed 's/=.*//')
  36.                 case "$PARAM" in
  37.                 # Some options are deprecated
  38.                 gpg)
  39.                     echo "WARNING: $dst in /etc/crypttab uses the deprecated gpg option, see man crypttab(5)." >&2
  40.                     ;;
  41.                 ssl)
  42.                     echo "WARNING: $dst in /etc/crypttab uses the deprecated ssl option, see man crypttab(5)." >&2
  43.                     ;;
  44.                 luks)
  45.                     plainopts="3"
  46.                     ;;
  47.                 cipher|hash|size)
  48.                     plainopts="$(($plainopts+1))"
  49.                     ;;
  50.                 esac
  51.             done
  52.             if [ "$plainopts" -lt "3" ]; then
  53.                 echo "WARNING: you need to set all of cipher, hash and size for the plain dm-crypt mapping $dst in /etc/crypttab." >&2
  54.             fi
  55.             unset IFS
  56.         fi
  57.  
  58.     done
  59.     ;;
  60.  
  61.     abort-upgrade|abort-remove|abort-deconfigure)
  62.  
  63.     ;;
  64.  
  65.     *)
  66.         echo "postinst called with unknown argument \`$1'" >&2
  67.         exit 1
  68.     ;;
  69. esac
  70.  
  71. # dh_installdeb will replace this with shell code automatically
  72. # generated by other debhelper scripts.
  73.  
  74. # Automatically added by dh_installinit
  75. if [ -x "/etc/init.d/cryptdisks-early" ]; then
  76.     update-rc.d cryptdisks-early start 26 S . start 59 0 6 . >/dev/null || exit $?
  77. fi
  78. # End automatically added section
  79. # Automatically added by dh_installinit
  80. if [ -x "/etc/init.d/cryptdisks" ]; then
  81.     update-rc.d cryptdisks start 28 S . start 48 0 6 . >/dev/null || exit $?
  82. fi
  83. # End automatically added section
  84.  
  85.  
  86. exit 0
  87.